/**
 * 
 */
package steffens.java.gui.defaultui;

import java.awt.BorderLayout;
import java.awt.Color;
import java.awt.Dimension;
import java.awt.Frame;
import java.awt.MenuBar;
import java.util.Arrays;
import java.util.List;

import steffens.java.gui.defaultui.bar.ButtonBar;
import steffens.java.gui.defaultui.bar.FieldStatusBar;
import steffens.java.gui.defaultui.bar.ProgressStatusBar;
import steffens.java.gui.defaultui.general.DefaultWindow;
import steffens.java.gui.defaultui.interactive.buttons.DefaultButton;
import steffens.java.gui.defaultui.interactive.buttons.eventbased.ConfirmButton;
import steffens.java.gui.defaultui.interactive.buttons.eventbased.DefaultEventButton;
import steffens.java.gui.defaultui.interactive.buttons.reflection.ReflectionButton;

/**
 * @author Steffen Baumann
 * @version 1.0 
 */

public class DefaultFrame extends DefaultWindow<Frame>{
	
	public DefaultFrame(String tilte, Dimension size, boolean centered) {
		super(new Frame(), size, centered);
		getWindow().setTitle(tilte);
		setDefaultCloseOperation(DISPOSE);
	}
	
	public void addMenuBar(MenuBar menuBar){
		getWindow().setMenuBar(menuBar);
	}

	@Override
	public Frame getWindow() {
		return super.getWindow();
	}
	

	public static void main(String[] args) throws InterruptedException {
		
		
		
//		bar3.setCurrentValue(0.652421);
//		bar1.setButtonOrientation(ButtonBar.VERTICAL);
//		bar1.setButtonAnchor(ButtonBar.WEST);
		
//		df.setButtonBar(bar1, BorderLayout.WEST);
//		bar1.setButtonAlignmentX(ButtonBar.RIGHT);
//		bar1.setButtonAlignmentY(ButtonBar.TOP);
//		bar1.setButtonAlignmentX(ButtonBar.LEFT);
//		bar1.setButtonAlignmentY(ButtonBar.BOTTOM);
//		bar1.setBarOrientation(ButtonBar.HORIZONTAL);

//		ConfirmButton cb = new ConfirmButton("OK");
//		cb.setMinimumSize(new Dimension(400,200));
//		df.setContent(cb);
//		df.setButtonBar(bar1, BorderLayout.WEST);
//		bar1.setBarOrientation(ButtonBar.VERTICAL);
//		bar1.setButtonAlignment();
//		bar1.getBarDimension();
//		bar1.setSize(new Dimension(200,100));
//		bar1.updateBar();
//		System.out.println(df.getWindow());
//		df.validate();
//		System.out.println(df.getWindow());
		
//		df.validate();
//		Thread.sleep(2000);
//		df.setButtonBarPosition(BorderLayout.WEST);
//		bar1.setBarOrientation(ButtonBar.VERTICAL);
//		List<DefaultButton> dbs2 = Arrays.asList(
//				new DefaultButton("Test0"),
//				new DefaultButton("Test1"),
//				new ConfirmButton("Test2")
//		);
//		ButtonBar bar2 = new ButtonBar(dbs2);
//		df.setButtonBarPosition(BorderLayout.WEST);
//		bar2.setButtonBarOrientation(ButtonBar.VERTICAL);
//		df.setButtonBar(bar2);
//		df.validate();
		
//		ConfirmButton cb = new ConfirmButton("OK");
//		ButtonEventListener listener = new ButtonEventListener() {
//			@Override
//			public void firedEvent(ReturnEvent event) {
//				System.out.println(event.getIDCode());
//				if(event.getIDCode() == ReturnEvent.OK){
//					System.out.println(((ConfirmEvent)event).getData());
//				}
//			}
//		};
//		DataGrabber grabber = new DataGrabber() {
//			
//			@Override
//			public Object grabDataFromElement() {
//				return df.getTitle();
//			}
//		};
//		cb.addButtonEventListeners(listener);
//		cb.setDataGrabber(grabber);
//		df.add(cb, BorderLayout.SOUTH);
//		df.setLayout(new FlowLayout());
	}	
}
